<?php

require_once dirname(__FILE__).'/../lib/tournamentGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/tournamentGeneratorHelper.class.php';

/**
 * tournament actions.
 *
 * @package    ingenyo
 * @subpackage tournament
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $
 */
class tournamentActions extends autoTournamentActions
{
	public function executeShowGames(sfWebRequest $request)
	{
		$this->redirect('game');
	}

	public function executeAddGame(sfWebRequest $request)
	{
		$this->redirect($this->generateUrl('tournament_add_game', array(
			'tournament_id' => $this->getRoute()->getObject()->getId())
		));
	}

	public function executeAddTeam(sfWebRequest $request)
	{
		#crea un torneo con el id recibido por parametro (hidden el tournament_id)
		#agrega equipos con el widget lindo

		#aunque se podria hacer como arriba (addGame) que va a game, en este caso que redirija
		#a TournamentTeam :)

		$this->redirect($this->generateUrl('tournament_add_team', array(
			'tournament_id' => $this->getRoute()->getObject()->getId())
		));

		//$this->tournament 	= new Tournament();
		//$this->form 		= new TournamentTeamForm(null,array('tournament_id' => $request->getParameter('id')));

		//$this->setTemplate('new');
                
	}
}
